package com.explorx.sns.puma.im.core.common.utils;

import cn.hutool.core.date.DateUtil;

import java.util.Date;

public class DateUtils {

    public static String buildMsgDateOrTime(Date date){
        if (DateUtil.isSameDay(date,new Date())) {
            return DateUtil.format(date,"HH:mm");
        }else {
            return DateUtil.format(date,"MM月dd日");
        }
    }

    public static String formatDateTime(Date date){
        return DateUtil.format(date,"MM月dd日 HH:mm");
    }
}
